<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
</head>

<body>
    <header class="aui-bar aui-bar-nav" style="background-color: #03a9f4;position:fixed;" id="header">
        <a class="aui-pull-left aui-btn" tapmode onclick="closeWin();">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title" id="title">
            生产交接班情况
        </div>
    </header>
    <div class="aui-content aui-margin-b-15" style="margin-top:50px;">
        <div
            style="background-color:white; width: 100%;margin-top:2%;overflow-x: auto;-webkit-overflow-scrolling:touch;">
            <table class="table" style='width:1320px;' id="table1">
                <tbody style="display:block">
                    <tr
                        style="text-align: center;background-color: #DCE9F2;color: #467aa7;font-size: 15px;font-weight: bold;">
                        <td algin='center' style='width:70px;'>班组名称</td>
                        <td algin='center' style='width:70px;'>班次名称</td>
                        <td algin='center' style='width:150px;'>产线编码</td>
                        <td algin='center' style='width:150px;'>工位</td>
                        <td algin='center' style='width:150px;'>生产日期</td>
                        <td algin='center' style='width:70px;'>交班人</td>
                        <td algin='center' style='width:70px;'>接班人</td>
                        <td algin='center' style='width:70px;'>交班班长</td>
                        <td algin='center' style='width:70px;'>接班班长</td>
                        <td algin='center' style='width:150px;'>生产完成</td>
                        <td algin='center' style='width:150px;'>产品质量</td>
                        <td algin='center' style='width:150px;'>创建时间</td>
                    </tr>
                </tbody>
            </table>
            <table class="table" style='width:1320px;' id="table">
                <tbody id="tbodyHtml" style="display: block;height: 600px;overflow-y: scroll;">
                </tbody>
            </table>
        </div>
    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="../script/public.js"></script>
<script type="text/javascript">

    //日期
    var scrapDate = "";
    var scrapDateEnd = "";
    //初始化
    apiready = function () {
        scrapDate = api.pageParam.scrapDate;
        scrapDateEnd = api.pageParam.scrapDateEnd;
        console.log(scrapDate)
        doSearch();
    }

    //查询
    function doSearch() {
        var un = localStorage.getItem('un');
        var serverUrl = localStorage.getItem('serverUrl');
        var url = serverUrl + "/app/getOperatorPerformanceScjjb";
        var data = {
            values: {
                un: un,
                scrapDate: scrapDate,
                scrapDateEnd: scrapDateEnd
            }
        };
        api.ajax({
            url: url,
            method: 'post',
            dataType: 'json',
            timeout: 300,
            returnAll: false,
            data: data
        }, function (ret, err) {
            if (ret) {
                var data = JSON.stringify(ret);
                var myobj = eval("(" + data + ")");

                //返回成功
                if (myobj.code == "0") {
                    var list = eval(myobj.list);
                    var html = "";
                    for (var i = 0; i < list.length; i++) {
                        html += "<tr style='text-align: center;color: black;font-size: 12px;background-color: #F5F5F5;'>";
                        html += "<td name='teamCode' style='width:70px;'>" + list[i].teamCode + "</td>";
                        html += "<td name='shift' style='width:70px;'>" + list[i].shift + "</td>";
                        html += "<td name='lineCode' style='width:150px;'>" + list[i].lineCode + "</td>";
                        html += "<td name='stationCode' style='width:150px;'>" + list[i].stationCode + "</td>";
                        html += "<td name='productDate' style='width:150px;'>" + list[i].productDate + "</td>";
                        html += "<td name='ext02' style='width:70px;'>" + list[i].ext02 + "</td>";
                        html += "<td name='ext04' style='width:70px;'>" + list[i].ext04 + "</td>";
                        html += "<td name='ext06' style='width:70px;'>" + list[i].ext06 + "</td>";
                        html += "<td name='ext08' style='width:70px;'>" + list[i].ext08 + "</td>";
                        html += "<td name='completeProduct' style='width:150px;'>" + list[i].completeProduct + "</td>";
                        html += "<td name='productQuality' style='width:150px;'>" + list[i].productQuality + "</td>";
                        html += "<td name='createDate' style='width:150px;'>" + list[i].createDate + "</td>";
                        html += "</tr>";
                    }
                    $api.html($api.byId("tbodyHtml"), html);

                    //失败
                } else if (myobj.code == "1") {

                    //清空表格数据
                    $api.html($api.byId("tbodyHtml"), "");
                    api.toast({
                        msg: myobj.message,
                        duration: 3000
                    });
                }
            }
        });
    }

    //订单返回按钮
    function closeWin() {
        api.closeWin({});
    }
</script>

<style>
    .c1 {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, .5);
        z-index: 99;
        margin-top: 0%;
    }

    .c2 {
        background-color: white;
        position: fixed;
        width: 400px;
        height: 300px;
        top: 50%;
        left: 50%;
        z-index: 100;
        margin-top: -125px;
        margin-left: -200px;
        padding-top: 2%;
        padding-left: 2%;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .hide {
        display: none;
    }
</style>

</html>